package com.itheima.extendsfeature;

public class Test2 {

    public static void main(String[] args) {

        //继承的特点：
        //  3.就近原则：在子类方法中访问其他成员，先在子类局部范围内找，然后子类成员范围找，
        //最后再父类范围找，如果父类范围还未找到就报错。
        Child child = new Child();
        child.show();
    }
}

class Father {

    String name = "张三";
}

class Child extends Father {

    String name = "李四";

    public void show() {
       String name = "王五";
       System.out.println(name);
       System.out.println(this.name);
       System.out.println(super.name);    //父类也叫超类
    }

}
